from rest_framework import serializers

from .models import Banner
class BannerListModelSerializer(serializers.ModelSerializer):
    class Meta:
        model=Banner
        fields=['image','link']


from .models import Nav
class NavModelSerializer(serializers.ModelSerializer):
    """导航菜单的序列化器"""
    class Meta:
        model = Nav
        fields = ["name","link","position","is_http"]